 /*
  * The contents of this file are subject to the Mozilla Public License
  * Version 1.1 (the "License");  you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  * http//www.mozilla.org/MPL/
  *
  * Software distributed under the License is distributed on an "AS IS" basis,
  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
  * the specific language governing rights and limitations under the License.
  *
  * The Original Code is ART Ontology API.
  *
  * The Initial Developer of the Original Code is University of Roma Tor Vergata.
  * Portions created by University of Roma Tor Vergata are Copyright (C) 2007.
  * All Rights Reserved.
  *
  * ART Ontology API was developed by the Artificial Intelligence Research Group
  * (ai-nlp.info.uniroma2.it) at the University of Roma Tor Vergata
  * Current information about the ART Ontology API can be obtained at 
  * http//ai-nlp.info.uniroma2.it/software/...
  *
  */

  /*
   * Contributor(s): Armando Stellato stellato@info.uniroma2.it
  */
package it.uniroma2.art.owlart.vocabulary;

import it.uniroma2.art.owlart.exceptions.VocabularyInitializationException;
import it.uniroma2.art.owlart.model.ARTURIResource;
import it.uniroma2.art.owlart.models.RDFModel;

/**
 * Vocabulary file for the OWL 1.0 W3C specification
 * 
 * @author Armando Stellato
 *
 */
public class OWL {

    /** http://www.w3.org/2002/07/owl# **/
    public static final String NAMESPACE = "http://www.w3.org/2002/07/owl#";

    // OWL Lite

    /** http://www.w3.org/2002/07/owl#Class **/
    public static final String CLASS = NAMESPACE + "Class";

    /** http://www.w3.org/2002/07/owl#Individual **/
    public static final String INDIVIDUAL = NAMESPACE + "Individual";

    /** http://www.w3.org/2002/07/owl#equivalentClass **/
    public static final String EQUIVALENTCLASS = NAMESPACE + "equivalentClass";

    /** http://www.w3.org/2002/07/owl#equivalentProperty **/
    public static final String EQUIVALENTPROPERTY = NAMESPACE + "equivalentProperty";

    /** http://www.w3.org/2002/07/owl#sameAs **/
    public static final String SAMEAS = NAMESPACE + "sameAs";

    /** http://www.w3.org/2002/07/owl#differentFrom **/
    public static final String DIFFERENTFROM = NAMESPACE + "differentFrom";

    /** http://www.w3.org/2002/07/owl#AllDifferent **/
    public static final String ALLDIFFERENT = NAMESPACE + "AllDifferent";

    /** http://www.w3.org/2002/07/owl#distinctMembers **/
    public static final String DISTINCTMEMBERS = NAMESPACE + "distinctMembers";

    /** http://www.w3.org/2002/07/owl#ObjectProperty **/
    public static final String OBJECTPROPERTY = NAMESPACE + "ObjectProperty";

    /** http://www.w3.org/2002/07/owl#DatatypeProperty **/
    public static final String DATATYPEPROPERTY = NAMESPACE + "DatatypeProperty";

    /** http://www.w3.org/2002/07/owl#inverseOf **/
    public static final String INVERSEOF = NAMESPACE + "inverseOf";

    /** http://www.w3.org/2002/07/owl#TransitiveProperty **/
    public static final String TRANSITIVEPROPERTY = NAMESPACE + "TransitiveProperty";

    /** http://www.w3.org/2002/07/owl#SymmetricProperty **/
    public static final String SYMMETRICPROPERTY = NAMESPACE + "SymmetricProperty";

    /** http://www.w3.org/2002/07/owl#FunctionalProperty **/
    public static final String FUNCTIONALPROPERTY = NAMESPACE + "FunctionalProperty";

    /** http://www.w3.org/2002/07/owl#InverseFunctionalProperty **/
    public static final String INVERSEFUNCTIONALPROPERTY = NAMESPACE + "InverseFunctionalProperty";

    /** http://www.w3.org/2002/07/owl#Restriction **/
    public static final String RESTRICTION = NAMESPACE + "Restriction";

    /** http://www.w3.org/2002/07/owl#onProperty **/
    public static final String ONPROPERTY = NAMESPACE + "onProperty";

    /** http://www.w3.org/2002/07/owl#allValuesFrom **/
    public static final String ALLVALUESFROM = NAMESPACE + "allValuesFrom";

    /** http://www.w3.org/2002/07/owl#someValuesFrom **/
    public static final String SOMEVALUESFROM = NAMESPACE + "someValuesFrom";

    /** http://www.w3.org/2002/07/owl#minCardinality **/
    public static final String MINCARDINALITY = NAMESPACE + "minCardinality";

    /** http://www.w3.org/2002/07/owl#maxCardinality **/
    public static final String MAXCARDINALITY = NAMESPACE + "maxCardinality";

    /** http://www.w3.org/2002/07/owl#cardinality **/
    public static final String CARDINALITY = NAMESPACE + "cardinality";

    /** http://www.w3.org/2002/07/owl#Ontology **/
    public static final String ONTOLOGY = NAMESPACE + "Ontology";

    /** http://www.w3.org/2002/07/owl#imports **/
    public static final String IMPORTS = NAMESPACE + "imports";

    /** http://www.w3.org/2002/07/owl#intersectionOf **/
    public static final String INTERSECTIONOF = NAMESPACE + "intersectionOf";

    /** http://www.w3.org/2002/07/owl#versionInfo **/
    public static final String VERSIONINFO = NAMESPACE + "versionInfo";

    /** http://www.w3.org/2002/07/owl#priorVersion **/
    public static final String PRIORVERSION = NAMESPACE + "priorVersion";

    /** http://www.w3.org/2002/07/owl#backwardCompatibleWith **/
    public static final String BACKWARDCOMPATIBLEWITH = NAMESPACE + "backwardCompatibleWith";

    /** http://www.w3.org/2002/07/owl#incompatibleWith **/
    public static final String INCOMPATIBLEWITH = NAMESPACE + "incompatibleWith";

    /** http://www.w3.org/2002/07/owl#DeprecatedClass **/
    public static final String DEPRECATEDCLASS = NAMESPACE + "DeprecatedClass";

    /** http://www.w3.org/2002/07/owl#DeprecatedProperty **/
    public static final String DEPRECATEDPROPERTY = NAMESPACE + "DeprecatedProperty";

    /** http://www.w3.org/2002/07/owl#AnnotationProperty **/
    public static final String ANNOTATIONPROPERTY = NAMESPACE + "AnnotationProperty";

    /** http://www.w3.org/2002/07/owl#OntologyProperty **/
    public static final String ONTOLOGYPROPERTY = NAMESPACE + "OntologyProperty";

    // OWL DL and OWL Full

    /** http://www.w3.org/2002/07/owl#oneOf **/
    public static final String ONEOF = NAMESPACE + "oneOf";

    /** http://www.w3.org/2002/07/owl#hasValue **/
    public static final String HASVALUE = NAMESPACE + "hasValue";

    /** http://www.w3.org/2002/07/owl#disjointWith **/
    public static final String DISJOINTWITH = NAMESPACE + "disjointWith";

    /** http://www.w3.org/2002/07/owl#unionOf **/
    public static final String UNIONOF = NAMESPACE + "unionOf";

    /** http://www.w3.org/2002/07/owl#complementOf **/
    public static final String COMPLEMENTOF = NAMESPACE + "complementOf";
    
    /** http://www.w3.org/2002/07/owl#Thing **/
    public static final String THING = NAMESPACE + "Thing";

    
    public static class Res {
    	
        public static ARTURIResource CLASS;
        public static ARTURIResource INDIVIDUAL;
        public static ARTURIResource EQUIVALENTCLASS;
        public static ARTURIResource EQUIVALENTPROPERTY;	
        public static ARTURIResource SAMEAS;
        public static ARTURIResource DIFFERENTFROM;
        public static ARTURIResource ALLDIFFERENT;
        public static ARTURIResource DISTINCTMEMBERS;
        public static ARTURIResource OBJECTPROPERTY;
        public static ARTURIResource DATATYPEPROPERTY;
        public static ARTURIResource INVERSEOF;
        public static ARTURIResource TRANSITIVEPROPERTY;      
        public static ARTURIResource SYMMETRICPROPERTY;
        public static ARTURIResource FUNCTIONALPROPERTY;
        public static ARTURIResource INVERSEFUNCTIONALPROPERTY;
        public static ARTURIResource RESTRICTION;
        public static ARTURIResource ONPROPERTY;
        public static ARTURIResource ALLVALUESFROM;
        public static ARTURIResource SOMEVALUESFROM;
        public static ARTURIResource MINCARDINALITY;
        public static ARTURIResource MAXCARDINALITY;       
        public static ARTURIResource CARDINALITY;
        public static ARTURIResource ONTOLOGY;
        public static ARTURIResource IMPORTS;
        public static ARTURIResource INTERSECTIONOF;
        public static ARTURIResource VERSIONINFO;
        public static ARTURIResource PRIORVERSION;
        public static ARTURIResource BACKWARDCOMPATIBLEWITH;
        public static ARTURIResource INCOMPATIBLEWITH;
        public static ARTURIResource DEPRECATEDCLASS;
        public static ARTURIResource DEPRECATEDPROPERTY;
        public static ARTURIResource ANNOTATIONPROPERTY;
        public static ARTURIResource ONTOLOGYPROPERTY;

        //OWL DL and OWL Full
        public static ARTURIResource ONEOF;
        public static ARTURIResource HASVALUE;
        public static ARTURIResource DISJOINTWITH;
        public static ARTURIResource UNIONOF;
        public static ARTURIResource COMPLEMENTOF;
        public static ARTURIResource THING;

        
        
        public static void initialize(RDFModel repo) throws VocabularyInitializationException {
        	
            CLASS                            = repo.createURIResource(OWL.CLASS                         );
            INDIVIDUAL                       = repo.createURIResource(OWL.INDIVIDUAL                    );  
            EQUIVALENTCLASS                  = repo.createURIResource(OWL.EQUIVALENTCLASS               );
            EQUIVALENTPROPERTY               = repo.createURIResource(OWL.EQUIVALENTPROPERTY            );
            SAMEAS                           = repo.createURIResource(OWL.SAMEAS                        );
            DIFFERENTFROM                    = repo.createURIResource(OWL.DIFFERENTFROM                 );
            ALLDIFFERENT                     = repo.createURIResource(OWL.ALLDIFFERENT                  );
            DISTINCTMEMBERS                  = repo.createURIResource(OWL.DISTINCTMEMBERS               );
            OBJECTPROPERTY                   = repo.createURIResource(OWL.OBJECTPROPERTY                );
            DATATYPEPROPERTY                 = repo.createURIResource(OWL.DATATYPEPROPERTY              );
            INVERSEOF                        = repo.createURIResource(OWL.INVERSEOF                     );
            TRANSITIVEPROPERTY               = repo.createURIResource(OWL.TRANSITIVEPROPERTY            );
            SYMMETRICPROPERTY                = repo.createURIResource(OWL.SYMMETRICPROPERTY             );
            FUNCTIONALPROPERTY               = repo.createURIResource(OWL.FUNCTIONALPROPERTY            );
            INVERSEFUNCTIONALPROPERTY        = repo.createURIResource(OWL.INVERSEFUNCTIONALPROPERTY     );
            RESTRICTION                      = repo.createURIResource(OWL.RESTRICTION                   );
            ONPROPERTY                       = repo.createURIResource(OWL.ONPROPERTY                    );
            ALLVALUESFROM                    = repo.createURIResource(OWL.ALLVALUESFROM                 );
            SOMEVALUESFROM                   = repo.createURIResource(OWL.SOMEVALUESFROM                );
            MINCARDINALITY                   = repo.createURIResource(OWL.MINCARDINALITY                );
            MAXCARDINALITY                   = repo.createURIResource(OWL.MAXCARDINALITY                );
            CARDINALITY                      = repo.createURIResource(OWL.CARDINALITY                   );
            ONTOLOGY                         = repo.createURIResource(OWL.ONTOLOGY                      );
            IMPORTS                          = repo.createURIResource(OWL.IMPORTS                       );
            INTERSECTIONOF                   = repo.createURIResource(OWL.INTERSECTIONOF                );
            VERSIONINFO                      = repo.createURIResource(OWL.VERSIONINFO                   );
            PRIORVERSION                     = repo.createURIResource(OWL.PRIORVERSION                  );
            BACKWARDCOMPATIBLEWITH           = repo.createURIResource(OWL.BACKWARDCOMPATIBLEWITH        );
            INCOMPATIBLEWITH                 = repo.createURIResource(OWL.INCOMPATIBLEWITH              );
            DEPRECATEDCLASS                  = repo.createURIResource(OWL.DEPRECATEDCLASS               );
            DEPRECATEDPROPERTY               = repo.createURIResource(OWL.DEPRECATEDPROPERTY            );
            ANNOTATIONPROPERTY               = repo.createURIResource(OWL.ANNOTATIONPROPERTY            );
            ONTOLOGYPROPERTY                 = repo.createURIResource(OWL.ONTOLOGYPROPERTY              );
            ONEOF                            = repo.createURIResource(OWL.ONEOF                         );
            HASVALUE                         = repo.createURIResource(OWL.HASVALUE                      );
            DISJOINTWITH                     = repo.createURIResource(OWL.DISJOINTWITH                  );
            UNIONOF                          = repo.createURIResource(OWL.UNIONOF                       );
            COMPLEMENTOF                     = repo.createURIResource(OWL.COMPLEMENTOF                  );
            THING                            = repo.createURIResource(OWL.THING                         );

            
            if (
            	  CLASS==null || (INDIVIDUAL==null) || (EQUIVALENTCLASS==null) || (EQUIVALENTPROPERTY==null) || (SAMEAS==null) || 
                  DIFFERENTFROM==null || (ALLDIFFERENT==null) || (DISTINCTMEMBERS==null) || (OBJECTPROPERTY==null) || (DATATYPEPROPERTY==null) || 
                  INVERSEOF==null || (TRANSITIVEPROPERTY==null) || (SYMMETRICPROPERTY==null) || (FUNCTIONALPROPERTY==null) || (INVERSEFUNCTIONALPROPERTY==null) ||
                  RESTRICTION==null || (ONPROPERTY==null) || (ALLVALUESFROM==null) || (SOMEVALUESFROM==null) || (MINCARDINALITY==null) ||
                  MAXCARDINALITY==null || (CARDINALITY==null) || (ONTOLOGY==null) || (IMPORTS==null) || (INTERSECTIONOF==null) ||
                  VERSIONINFO==null || (PRIORVERSION==null) || (BACKWARDCOMPATIBLEWITH==null) || (INCOMPATIBLEWITH==null) || 
                  DEPRECATEDCLASS==null || (DEPRECATEDPROPERTY==null) || (ANNOTATIONPROPERTY==null) || (ONTOLOGYPROPERTY==null) || (PRIORVERSION==null) || 
                  ONEOF==null || (HASVALUE==null) || (DISJOINTWITH==null) || (UNIONOF==null) || (COMPLEMENTOF==null) ||
                  THING==null 
            )            
            {	
            	printVocabularyInitialization();
            	throw new VocabularyInitializationException("Problems occurred in initializing the OWL vocabulary");
            }
            
        }

        private static void printVocabularyInitialization() {
        	System.err.println("CLASS                      : " +  CLASS                      );
        	System.err.println("INDIVIDUAL                 : " +  INDIVIDUAL                 );
        	System.err.println("EQUIVALENTCLASS            : " +  EQUIVALENTCLASS            );
        	System.err.println("EQUIVALENTPROPERTY  	   : " +  EQUIVALENTPROPERTY  	     );
        	System.err.println("SAMEAS                     : " +  SAMEAS                     );
        	System.err.println("DIFFERENTFROM              : " +  DIFFERENTFROM              );
        	System.err.println("ALLDIFFERENT               : " +  ALLDIFFERENT               );
        	System.err.println("DISTINCTMEMBERS            : " +  DISTINCTMEMBERS            );
        	System.err.println("OBJECTPROPERTY             : " +  OBJECTPROPERTY             );
        	System.err.println("DATATYPEPROPERTY           : " +  DATATYPEPROPERTY           );
        	System.err.println("INVERSEOF                  : " +  INVERSEOF                  );
        	System.err.println("TRANSITIVEPROPERTY         : " +  TRANSITIVEPROPERTY         );
        	System.err.println("SYMMETRICPROPERTY          : " +  SYMMETRICPROPERTY          );
        	System.err.println("FUNCTIONALPROPERTY         : " +  FUNCTIONALPROPERTY         );
        	System.err.println("INVERSEFUNCTIONALPROPERTY  : " +  INVERSEFUNCTIONALPROPERTY  );
        	System.err.println("RESTRICTION                : " +  RESTRICTION              ); 
        	System.err.println("ONPROPERTY                 : " +  ONPROPERTY              );
        	System.err.println("ALLVALUESFROM              : " +  ALLVALUESFROM           );
        	System.err.println("SOMEVALUESFROM             : " +  SOMEVALUESFROM          );
        	System.err.println("MINCARDINALITY             : " +  MINCARDINALITY          );
        	System.err.println("MAXCARDINALITY             : " +  MAXCARDINALITY          );
        	System.err.println("CARDINALITY                : " +  CARDINALITY             );
        	System.err.println("ONTOLOGY                   : " +  ONTOLOGY                );
        	System.err.println("IMPORTS                    : " +  IMPORTS                 );
        	System.err.println("INTERSECTIONOF             : " +  INTERSECTIONOF          );
        	System.err.println("VERSIONINFO                : " +  VERSIONINFO             );
        	System.err.println("PRIORVERSION               : " +  PRIORVERSION            );
        	System.err.println("BACKWARDCOMPATIBLEWITH     : " +  BACKWARDCOMPATIBLEWITH  );
        	System.err.println("INCOMPATIBLEWITH           : " +  INCOMPATIBLEWITH        );
        	System.err.println("DEPRECATEDCLASS            : " +  DEPRECATEDCLASS         );
        	System.err.println("DEPRECATEDPROPERTY         : " +  DEPRECATEDPROPERTY      );
        	System.err.println("ANNOTATIONPROPERTY         : " +  ANNOTATIONPROPERTY      );
        	System.err.println("ONTOLOGYPROPERTY           : " +  ONTOLOGYPROPERTY        );
        	System.err.println("ONEOF                      : " +  ONEOF                   );
        	System.err.println("HASVALUE                   : " +  HASVALUE                );
        	System.err.println("DISJOINTWITH               : " +  DISJOINTWITH            );
        	System.err.println("UNIONOF                    : " +  UNIONOF                 );
        	System.err.println("COMPLEMENTOF               : " +  COMPLEMENTOF            );
        	System.err.println("THING                      : " +  THING                   );


        }
        
    }
    
    
}
